// @ts-ignore
/* eslint-disable */
import request from '@/utils/request'

/** 此处后端没有提供注释 GET /comment/${param0} */
export async function getReviewsByProductId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: MallService.getReviewsByProductIdParams,
  options?: { [key: string]: any }
) {
  const { productId: param0, ...queryParams } = params
  return request<MallService.ResultListProductReviewVO>(`/mall/comment/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 DELETE /comment/${param0} */
export async function deleteReview(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: MallService.deleteReviewParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<MallService.ResultObject>(`/mall/comment/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /comment/add */
export async function addComment(
  body: MallService.BizProductReview,
  options?: { [key: string]: any }
) {
  return request<MallService.ResultObject>(`/mall/comment/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
